import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class validateinput {
	
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		float a,b,c=0;
		
		BufferedReader object= new BufferedReader (new InputStreamReader(System.in));
		
		while(true)
		{
			try
			{
			  System.out.println("Enter first side a");
			  a=Float.parseFloat(object.readLine());
			
			  if(a<=0)
			  {
				 System.out.println("enter positive non zero number");	
			  }
			  else
			  {
				System.out.println("first side is " +a);
				break;
			  }
			}
			catch(Exception e)
			{
				System.out.println("enter number only");
			}
		}
			
		while(true)
		{
			try
			{
			  System.out.println("enter second side b");
			  b=Float.parseFloat(object.readLine());
			
			  if(b<=0)
			  {
				  System.out.println("enter positive non zero number");
			  }
			  else
			  {
				 System.out.println("second side is " +b);
				 break;
			  }
			}
			catch(Exception e)
			{
				System.out.println("enter number only");
			}
		}
		
		while(true)
		{
			try
			{
			  System.out.println("enter third side c");
			  c=Float.parseFloat(object.readLine());
			
			if(c<=0)
			{
				System.out.println("enter positive non zero number");
			}
			
			else
			{
				System.out.println("third side is " +c);
				break;
			}
			}
			catch(Exception e)
			{
				System.out.println("enter number only");
			}
		}
		
		   if((a+b) <c || (b+c)<a || (a+c)<b)
			{
				System.out.println("these are not valid sides of a triangle..please enter correct sides");
				        
				while(true)
				{
					try
					{
					  System.out.println("enter first side a");
					  a=Float.parseFloat(object.readLine());
					
					 if(a<=0)
					 {
						System.out.println("enter positive non zero number");	
					 }
					else
					{
						System.out.println("first side is " +a);
						break;
					}
					}
					catch(Exception e)
					{
						System.out.println("enter number only");
					}
				}
					
				while(true)
				{
					try
					{
					  System.out.println("enter second side b");
					  b=Float.parseFloat(object.readLine());
					
					if(b<=0)
					{
						System.out.println("enter positive non zero number");	
					}
					else
					{
						System.out.println("second side is " +b);
						break;
					}
					}
					catch(Exception e)
					{
						System.out.println("enter number only");
					}
				}
				while(true)
				{
					try
					{
					System.out.println("enter third side c");
					c=Float.parseFloat(object.readLine());
					
					if(c<=0)
					{
						System.out.println("enter positive non zero number");
						
					}
					else
					{
						System.out.println("third side is " +c);
						break;
					}
					}
					catch(Exception e)
					{
						System.out.println("enter number only");
					}
				}
			
			}//end of if checking valid sides
			
				if((a==b) && (b==c) && (a==c))
				{
					System.out.println("triangle is equilateral");
				}

				if (a==b && b!=c ||b==c && a!=c || a==c && a!=b )
				{
					System.out.println("triangle is isoscales");
					
				}
				
				if(a!=b && b!=c && a!=c)
				{
					System.out.println("triangle is scalene");
					
				}
				
				if(a*a + b*b == c*c)
				{
					System.out.println("traingle is right angled");
				}
				
				if(a>b && a>c )
				{
					float g=a;
				
				if ((b*b + c*c)==g*g)
				{
					System.out.println("triangle is right angled");
					
				}
			
				
			}
	}

}

